import { http } from '@/utils/http'

// 获取用户信息
export function getUserInfo(): Promise<IResData<RUserInfo>> {
  return http.get('/api/fuwu/user')
}

// 上传图片
export function uploadImage(image: any) {
  return http.post('/api/fuwu/upload_image', {}, { image })
}

// 完善用户信息
export function completeUserInfo(params: ICompleteUserInfo) {
  return http.post('/api/fuwu/perfect', params, params)
}

// 服务类型
export function getServiceType(): Promise<IResData<RServiceType[]>> {
  return http.get('/api/fuwu/service')
}

// 我的订单
export function getOrderList(params: IOrderList): Promise<IResData<ROrderData>> {
  return http.get('/api/fuwu/my_orders', params)
}
// 需求列表分页
export function getDemandList(params: IDemand): Promise<IResData<RDemand>> {
  return http.get('/api/fuwu/index', params)
}

// 去联系
export function toContact(params: IContact) {
  return http.post('/api/fuwu/contact', params, params)
}
// 联系说明
export function getContactExplain(): Promise<IResData<RContact>> {
  return http.get('/api/fuwu/explain')
}

// 支付下单
export function payOrder(id: number): Promise<IResData<RPayOrder>> {
  return http.post('/api/fuwu/orders', { id }, { id })
}
